package com.yonyou.distribute.controller;

import com.yonyou.distribute.service.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class RedisController {

    @Resource
    private RedisService_1 redisService_1;


    @Resource
    private RedisService_2 redisService_2;

    @Resource
    private RedisService_3 redisService_3;


    @Resource
    private RedisService_4 redisService_4;


    @Resource
    private RedisService_5 redisService_5;


    @Resource
    private RedisService_6 redisService_6;

    @GetMapping("/redis/stock/deduct")
    public String deduct(){
        this.redisService_1.deduct();
        return "hello stock deduct";
    }

    @GetMapping("/redis/multi/stock/deduct")
    public String deduct_multi(){
        this.redisService_2.deduct();
        return "hello stock deduct";
    }

    @GetMapping("/redis/distribute/stock/deduct")
    public String deduct_distribute(){
        this.redisService_3.deduct();
        return "hello stock deduct";
    }

    @GetMapping("/redis/distribute2/stock/deduct")
    public String deduct_distribute2(){
        this.redisService_4.deduct();
        return "hello stock deduct_distribute2";
    }

    @GetMapping("/redis/distribute3/stock/deduct")
    public String deduct_distribute3(){
        this.redisService_5.deduct();
        return "hello stock deduct_distribute3";
    }


    @GetMapping("/redis/distribute4/stock/deduct")
    public String deduct_distribute4(){
        this.redisService_6.deduct();
        return "hello stock deduct_distribute4";
    }
}
